package megadrum.mididata;

import megadrum.Common;

public abstract class SysexRequest {

    public static byte[] firmwareUpdateRequest() {

        byte[] req = {
            Common.SYSEX_BEGIN,
            Common.ERASEFIRMWARE_B1,
            Common.ERASEFIRMWARE_B2,
            Common.SYSEX_END
        };
        return req;
    }

    public static byte[] firmwareInfoRequest(int chainID) {

        byte[] req = {
            Common.SYSEX_BEGIN,
            Common.SYSEX_ID,
            (byte) chainID,
            Common.TYPE_FIRMWAREINFO,
            Common.SYSEX_END
        };
        return req;
    }

    public static byte[] writeEEPROMRequest(int chainID) {

        byte[] req = {
            Common.SYSEX_BEGIN,
            Common.SYSEX_ID,
            (byte) chainID,
            Common.TYPE_EEPROM_WRITE,
            Common.SYSEX_END
        };
        return req;
    }

    public static byte[] customCurveRequest(int chainID, int curve) {

        byte[] req = {
            Common.SYSEX_BEGIN,
            Common.SYSEX_ID,
            (byte) chainID,
            Common.TYPE_CUSTOMCURVE,
            (byte) curve,
            Common.SYSEX_END
        };
        return req;
    }

    public static byte[] hihatConfigRequest(int chainID) {

        byte[] req = {
            Common.SYSEX_BEGIN,
            Common.SYSEX_ID,
            (byte) chainID,
            Common.TYPE_HIHAT,
            Common.SYSEX_END
        };
        return req;
    }

    public static byte[] miscConfigRequest(int chainID) {

        byte[] req = {
            Common.SYSEX_BEGIN,
            Common.SYSEX_ID,
            (byte) chainID,
            Common.TYPE_MISC,
            Common.SYSEX_END
        };
        return req;
    }

    public static byte[] subpadConfigRequest(int chainID, int padNumber) {

        byte[] req = {
            Common.SYSEX_BEGIN,
            Common.SYSEX_ID,
            (byte) chainID,
            Common.TYPE_PAD,
            (byte) (padNumber),
            Common.SYSEX_END
        };
        return req;
    }

    public static byte[] thirdZoneConfigRequest(int chainID, int padNumber) {
        byte[] req = {
            Common.SYSEX_BEGIN,
            Common.SYSEX_ID,
            (byte) chainID,
            Common.TYPE_3ZONE,
            (byte) padNumber,
            Common.SYSEX_END
        };
        return req;
    }

}
